package com.example.studentdemo.service;

import com.example.studentdemo.entity.SubjectStudent;
import com.github.pagehelper.PageInfo;

import java.util.List;

public interface SubjectStudentService {
    /**
     * 查询所有 subject_student 记录
     */
    List<SubjectStudent> selectAll(SubjectStudent subjectStudent);

    /**
     * 分页查询 subject_student 记录
     */
    PageInfo<SubjectStudent> selectPage(Integer pageNum, Integer pageSize, SubjectStudent subjectStudent);

    /**
     * 添加学生到课程
     */
    void addStudentToSubject(SubjectStudent subjectStudent);

    /**
     * 批量添加学生到课程
     */
    void batchAddStudentsToSubject(Integer subjectId, List<Integer> studentIds);

    /**
     * 从课程中移除学生
     */
    void removeStudentFromSubject(SubjectStudent subjectStudent);

    /**
     * 根据课程ID查询学生
     */
    List<SubjectStudent> selectBySubjectId(Integer subjectId);

    /**
     * 根据学生ID查询课程
     */
    List<SubjectStudent> selectByStudentId(Integer studentId);

    /**
     * 根据课程ID删除所有相关记录
     */
    void deleteBySubjectId(Integer subjectId);

    /**
     * 根据学生ID删除所有相关记录
     */
    void deleteByStudentId(Integer studentId);

    void batchRemoveStudentsFromSubject(Integer subjectId, List<Integer> studentIds);
}